#include "rendercachekey.h"

QDataStream& operator<<(QDataStream& s, const RenderCacheKey& d)
{
	qint32 ver = 1;

	s << ver;
	s << d.pageNumber;
	s << d.cropRect;
	s << d.resolution;

	return s;
}

QDataStream& operator>>(QDataStream& s, RenderCacheKey& d)
{
	qint32 ver;

	s >> ver;
	if (ver >= 1) {
		s >> d.pageNumber;
		s >> d.cropRect;
		s >> d.resolution;
	} else {
		s.setStatus(QDataStream::ReadCorruptData);
	}

	return s;
}
